package cn.tedu.mall.seckill.exception;

import cn.tedu.mall.common.restful.JsonResult;
import cn.tedu.mall.common.restful.ResponseCode;
import cn.tedu.mall.pojo.seckill.dto.SeckillOrderAddDTO;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import lombok.extern.slf4j.Slf4j;

/**
 * @author BJ
 * @date 2022/11/10 11:58
 */
// 秒杀业务的降级处理类
@Slf4j
public class SeckillFallBack {

    public JsonResult fallBack(String randCode,
                               SeckillOrderAddDTO seckillOrderAddDTO,
                               Throwable e){
        log.error("服务器降级！");
        e.printStackTrace();
        return JsonResult.failed(ResponseCode.INTERNAL_SERVER_ERROR,"服务器忙，请稍后在试！");
    }

}
